function DateRange(from,to) {
	this.from=from;	// Date object
	this.to=to;		// Date object
	
	/** The duration in min of the time range */
	this.duration=function() { // in minutes
		return parseInt( this.to.diff(this.from)/60000 );
	};
	/**
	 * Zooms the range and interval, in or out.
	 * NOTE: After zoom, attendees avail must be updated.
	 * @return boolean
	 *		true if zoom is successful
	 */
	this.zoom=function( out ) { // out==1, in==-1;
		if ( out!=1&&out!=-1 ) return false;
		var offset=out*parseInt(this.duration()/(3-out))*60000;
		this.from.setTime(this.from.getTime()-offset);
		this.to.setTime(this.to.getTime()+offset);
		return true;
	};
	/** 
	 * Move range one interval to the left or right
	 *
	 * @param left boolean
	 * 	whether to move range left or right
	 */
	this.move=function( length ) { // length in min, left<0, right>0
		this.from.setTime(this.from.getTime()+length*60000);
		this.to.setTime(this.to.getTime()+length*60000);
	};
	
	this.format=function( mask ) {
		if ( mask==null ) mask="y-m-d H:i:s";
		return this.from.format(mask)+" - "+this.to.format(mask);
	}	
}
//console.debug.ex_dr=new DateRange( new Date(3600*24*365*20*1000), new Date(3600*24*365*20*1000+3600*24*1000) );